<?php
/**
 * Created by PhpStorm.
 * User: ZT
 * Date: 2020/7/9 0009
 * Time: 10:08
 **/
namespace frontend\controllers;
use backend\component\ResultFormat;
use common\component\Constant;
use common\models\info\Category;
use common\utils\CommonUtil;
use frontend\component\FrontendBaseController;
use frontend\service\ArticleService;
use Yii;
use yii\web\Controller;
class ArticleController extends FrontendBaseController{
    public function actionList(){
        $page = \Yii::$app->request->get("page");
        $pageSize = \Yii::$app->request->get("pageSize",20);
        $result = ArticleService::getIndexData($page,$pageSize);
        return ResultFormat::success('SUCCESS',$result);
    }
    public function actionPreview($aid){
        $DetailArticle = ArticleService::getDetailArticle($aid);
        return $this->render("detail",$DetailArticle);
    }
}